package com.april.pattern.behavioral.observer;

import org.junit.jupiter.api.Test;

/**
 * @author April
 * @version V1.0.0
 * @date 2019/07/09 11:43
 * @description 观察者模式
 */
public class ObserverTest {
    @Test
    public void observerTest() {
        Course course = new Course("Java设计模式");
        Teacher teacher = new Teacher("Alpha");

        course.addPropertyChangeListener(teacher);

        Question question = new Question();
        question.setUserName("April");
        question.setQuestionContent("第一个问题");

        course.proposeQuestion(question);
    }
}
